<ul class="breadcrumb">
  <li><a href="{:U(GROUP_NAME . '/Index/index')}">首页</a> <span class="divider">/</span></li>
  <li class="active">修改密码</li>
</ul>

<form class="form-horizontal" method="post" action="{:U(GROUP_NAME . '/Person/changePasswordHandle')}">
  <div class="control-group">
    <label class="control-label" for="oldPassword">旧密码</label>
    <div class="controls">
      <input type="password" class="span5" id="oldPassword" name="oldPassword" placeholder="旧密码" required>
    </div>
  </div>

  <div class="control-group">
    <label class="control-label" for="newPassword">新密码</label>
    <div class="controls">
      <input type="password" class="span5" id="newPassword" name="newPassword" placeholder="新密码" required>
    </div>
  </div>

  <div class="control-group">
    <label class="control-label" for="confirm">确认新密码</label>
    <div class="controls">
      <input type="password" class="span5" id="confirm" placeholder="确认新密码" required>
    </div>
  </div>

  <div class="control-group">
    <div class="controls">
      <button type="submit" id="submit" class="btn btn-primary span2">确认修改</button>
    </div>
  </div>
</form>

<script>
  $(function(){
    $('#confirm').bind('blur',function(){
      if($(this).val()==$('#newPassword').val()||$(this).val()==''){
        return;
      }
      alert('两次输入密码不同，请重新输入');
      $(this).val('');
      $(this).focus();
    })
    var test=/^[\w\W]{6,}$/;
    var rep=new RegExp(test);
    $('#confirm,#newPassword,#oldPassword').bind('blur',function(){
      if(rep.test($(this).val())||$(this).val()==''){

        return;
      }
      
      alert('请确认密码长度大于6');
      $(this).val('');
      $(this).focus();
    })
  })
</script>